import { View } from "../../../mvc/core/View";
import { ParamsConst } from "../../../common/global/ParamsConst";
import { LayerManager } from "../../manager/LayerManager";
import { ObjCreate } from "../common/ObjCreate";
import { BrowerUtil } from "../../../../com/gengine/utils/BrowerUtil";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
//class LinkIcon
    
    export  class LinkIcon extends View
    {
        constructor()
        {
            super();
            this._linkUrl = ParamsConst.instance.linkUrl;
            this.layer = LayerManager.rightTopUILayer;
            this.init();
            return;
        }

        protected init(): void
        {
            this._btn = ObjCreate.createGLoadedButton("", 0, 0, 60, 50, this);
            this._btn.configEventListener(flash.events.MouseEvent.CLICK, this.onClickBtn);
            return;
        }

        public setLinkUrl(arg1: string, arg2: string): void
        {
            this._linkUrl = arg2;
            this._btnResName = arg1;
            this._btn.styleName = arg1;
            return;
        }

        /* internal  */onClickBtn(arg1: Object /* flash.events.MouseEvent */): void
        {
            BrowerUtil.getUrl(this._linkUrl);
            return;
        }

        protected /* override */ disposeImpl(arg1: Boolean=true): void
        {
            this._btn.dispose();
            super.disposeImpl(arg1);
            return;
        }

        public /* override */ dispose(arg1: Boolean=true): void
        {
            return;
        }

        /* internal */ /* var */_btn: GLoadedButton;

        /* internal */ /* var */_linkUrl: string="";

        /* internal */ /* var */_btnResName: string;
    }
